USE KQXS
GO
SET ANSI_NULLS, QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[proc_Users_getQuyen]
@UName as nvarchar(100),
@IID as nvarchar(100)
WITH ENCRYPTION 
AS
declare @Quyen as int
BEGIN
	IF((SELECT COUNT(*) from URight Where UPPER(UName) =UPPER(@Uname) AND UPPER(IID) = UPPER(@IID) AND isPublic =1)> 0)
		BEGIN
		select UR From URight Where UPPER(UName) =UPPER(@Uname) AND UPPER(IID) = UPPER(@IID) AND isPublic =1
		END 
	else
		BEGIN
		select '5'
		END
END
GO
